﻿<Window x:Class="WPFGeniusSudoku.MainForm"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sudoku="clr-namespace:WPFGeniusSudoku"
    WindowStyle="None" Background="Transparent" AllowsTransparency="True"
    Title="GeniusSudoku" Height="600" Width="800" Icon="MainIcon.ico">

  <Grid Background="Transparent" ShowGridLines="False">
    <Grid.Resources>
      <Style x:Key="{x:Type Thumb}" TargetType="{x:Type Thumb}">
        <Setter Property="Opacity" Value="0" />
      </Style>
    </Grid.Resources>
    <Grid.RowDefinitions>
      <RowDefinition Height="3" />
      <RowDefinition Height="*" />
      <RowDefinition Height="5" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="5" />
      <ColumnDefinition Width="*" />
      <ColumnDefinition Width="5" />
    </Grid.ColumnDefinitions>

    <!-- background window, represened by rectangle-->
    <Rectangle Grid.RowSpan="3" Grid.ColumnSpan="3" Grid.Row="0" Grid.Column="0" 
               RadiusX="10" RadiusY="10" Stroke="Black" StrokeThickness="1"
               Fill="{StaticResource WindowBackground}">
    </Rectangle>
    <Rectangle Grid.RowSpan="3" Grid.ColumnSpan="3" Grid.Row="0" Grid.Column="0" RadiusX="10" RadiusY="10" StrokeThickness="1" Stroke="Gray">
      <Rectangle.Fill>
        <SolidColorBrush Opacity="0.7" Color="WhiteSmoke" />
      </Rectangle.Fill>
    </Rectangle>

    <!-- begin insert your content -->

    <!--<Rectangle Grid.Column="1" Grid.Row="1" Fill="Green"/>-->
    <Grid Grid.Column="1" Grid.Row="1" Margin="0,15,0,0">
      <sudoku:SudokuUC >

      </sudoku:SudokuUC>
    </Grid>
    <!-- end insert your content -->
    <!-- top bar, round effect-->
    <Grid Grid.Column="0" Background="Transparent" Grid.ColumnSpan="3" Grid.Row="0" Grid.RowSpan="2" Height="20" VerticalAlignment="Top">
      <Rectangle VerticalAlignment="Top" RadiusX="6" RadiusY="6" Opacity="0.8" Stroke="Transparent" Height="15px">
        <Rectangle.Fill>
          <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
            <LinearGradientBrush.GradientStops>
              <GradientStop Offset="0" Color="#ccffffff" />
              <GradientStop Offset="1" Color="Transparent" />
            </LinearGradientBrush.GradientStops>
          </LinearGradientBrush>
        </Rectangle.Fill>
      </Rectangle>
      <Thumb Opacity="0" Cursor="SizeAll" DragDelta="MoveWindow" MouseDoubleClick="MaximizeApplication"/>
      <!--<Thumb x:Name="moveThumb" Opacity="0" Cursor="SizeAll" MouseLeftButtonDown="OnMoveWindowRequired"/>-->
      <!-- close -->
      <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,10,0">
        <Button x:Name="MinimizeButton" Style="{StaticResource AppMinimizeButtonStyle}" Margin="0,4,3,0" Click="MinimizeApplication"/>
        <Button x:Name="MaximizeButton" Style="{StaticResource AppMaximizeButtonStyle}" Margin="0,4,3,0" Click="MaximizeApplication"/>
        <Button x:Name="CloseButton" Style="{StaticResource AppCloseButtonStyle}" Click="CloseApplication"/>
      </StackPanel>
    </Grid>

    <!--bottom round effect-->
    <Rectangle Grid.RowSpan="3" Grid.ColumnSpan="3" Grid.Row="0" Grid.Column="0" Margin="4,2,4,0" VerticalAlignment="Bottom" RadiusX="6" RadiusY="6" 
               Opacity="0.6" Stroke="Transparent" Height="15px">
      <Rectangle.Fill>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
          <LinearGradientBrush.GradientStops>
            <GradientStop Offset="1" Color="#ccffffff" />
            <GradientStop Offset="0" Color="Transparent" />
          </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
      </Rectangle.Fill>
    </Rectangle>

    <Grid x:Name="ModalHost" Grid.RowSpan="3" Grid.ColumnSpan="3" Grid.Row="0" Grid.Column="0" Visibility="Collapsed">
      <Rectangle Fill="#50000000" RadiusX="10" RadiusY="10"/>
      <Grid Margin="100">
        <Rectangle Fill="{StaticResource WindowBackground}" RadiusX="10" RadiusY="10"/>
        <Rectangle RadiusX="10" RadiusY="10" StrokeThickness="1" Stroke="Gray">
          <Rectangle.Fill>
            <SolidColorBrush Opacity="0.7" Color="WhiteSmoke" />
          </Rectangle.Fill>
        </Rectangle>
        <Rectangle VerticalAlignment="Top" RadiusX="6" RadiusY="6" Opacity="0.8" Stroke="Transparent" Height="15px" Margin="3,1,3,0">
          <Rectangle.Fill>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
              <GradientStop Offset="0" Color="#ccffffff" />
              <GradientStop Offset="1" Color="Transparent" />
            </LinearGradientBrush>
          </Rectangle.Fill>
        </Rectangle>
        <Rectangle Margin="4,2,4,0" VerticalAlignment="Bottom" RadiusX="6" RadiusY="6" 
           Opacity="0.6" Stroke="Transparent" Height="15px">
          <Rectangle.Fill>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
              <GradientStop Offset="1" Color="#ccffffff" />
              <GradientStop Offset="0" Color="Transparent" />
            </LinearGradientBrush>
          </Rectangle.Fill>
        </Rectangle>
        <Grid Margin="1,4,1,2">
          <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition />
          </Grid.RowDefinitions>
          <Button x:Name="ModalCloseButton" Style="{StaticResource AppCloseButtonStyle}" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,10,0" Click="OnModalClose"/>
          <Grid x:Name="ModalContent" Grid.Row="1">
            
          </Grid>
        </Grid>
      </Grid>
    </Grid>


    <!-- Thumbs for sizing the window -->

    <Thumb Grid.Row="0" Grid.Column="0" DragDelta="SizeWindow" x:Name="sizeWindowUpLeft" />
    <Thumb Grid.Row="0" Grid.Column="1" DragDelta="SizeWindow" x:Name="sizeWindowUp" Cursor="SizeNS" />
    <Thumb Grid.Row="0" Grid.Column="2" DragDelta="SizeWindow" x:Name="sizeWindowUpRight" Cursor="SizeNESW" />

    <Thumb Grid.Row="1" Grid.Column="0" DragDelta="SizeWindow" x:Name="sizeWindowLeft" Cursor="SizeWE" />
    <Thumb Grid.Row="1" Grid.Column="2" DragDelta="SizeWindow" x:Name="sizeWindowRight" Cursor="SizeWE" />

    <Thumb Grid.Row="2" Grid.Column="0" DragDelta="SizeWindow" x:Name="sizeWindowDownLeft" Cursor="SizeNESW" />
    <Thumb Grid.Row="2" Grid.Column="1" DragDelta="SizeWindow" x:Name="sizeWindowDown" Cursor="SizeNS" />
    <Thumb Grid.Row="2" Grid.Column="2" DragDelta="SizeWindow" x:Name="sizeWindowDownRight" Cursor="SizeNWSE" />


  </Grid>
</Window>
